[ykj_id].vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div class="cjfx_cjd">
  3. <NavHeader />
  4. <bread-crumb />
  5. <div class="w-1200px m-auto flex flex-row justify-between mainCotent">
  6. <div class="w-188px">
  7. <leftSider :activeIndex="activeIndex" :ykjId="ykjId" @parentClick="parentClick"/>
  8. </div>
  9. <div class="w-942px p-4 blueBg">
  10. <div class="flex items-center">
  11. <optionSelect @optionClick="optionClick" />
  12. </div>
  13. <div class="mt-4 exportBtn">
  14. <el-button color="#003eee" type="primary" size="large" @click="exportBtn">导出</el-button>
  15. </div>
  16. <div class="h-218px mt-5px bg-gray-500 py-4 pl-150px pr-100px perfectShow">
  17. <div class="h-full flex justify-between" v-if="rangeData.length!=0">
  18. <div class="h-full bg-opacity-20 rounded singlepart" v-for="(item, index) in rangeData" :key="index">
  19. <div class="h-1/3 text-center py-4 RankLabel">
  20. <img :src="'/images/one'+(index+1)+'.png'" alt="">
  21. </div>
  22. <div class="text-sm p-5px RankBaseInfo">
  23. <p class="h-1/4">考号:{{ item.kh }}</p>
  24. <p class="h-1/4">成绩:{{item.cj}}分</p>
  25. <p class="h-1/4">名次:{{ item.mc }}</p>
  26. <p class="h-1/4">学校:{{ item.xx }}</p>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="text-center " style="line-height:218px;" v-else>
  31. 暂无排名~
  32. </div>
  33. </div>
  34. <el-table :data="tableData" :border="true" :show-header="true" :header-row-style="{ background: '#003eee' }">
  35. <el-table-column v-for="(item, index) in tableHeader" :key="index" :prop="item.prop" :label="item.label" :width="item.width">
  36. <template v-if="item.children">
  37. <el-table-column v-for="(childItem, childIndex) in item.children" :key="childIndex" :prop="childItem.prop" :label="childItem.label" :width="childItem.width"></el-table-column>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. </div>
  43. <commonFooter />
  44. </div>
  45. </template>
  46. <route lang="json">
  47. {
  48. "meta": {
  49. "title": "考试分析",
  50. "breadcrumb": true
  51. }
  52. }
  53. </route>
  54. <script lang="ts" setup>
  55. import {cjfx_cjd_list } from '../apiItem';
  56. import {user} from "~/store";
  57. const route = useRoute();
  58. // 侧边栏点击
  59. const activeIndex = ref('1-1');
  60. let ykjId = ref();
  61. const parentClick = (val: string) => {
  62. activeIndex.value = val;
  63. ykjId.value = route.params.ykj_id;
  64. }
  65. const rangeData =ref([])
  66. const tableHeader =ref([]);
  67. const tableData = ref([]);
  68. ykjId.value = route.params.ykj_id;
  69. onMounted(() => {
  70. initData();
  71. })
  72. const school_id = ref("");
  73. const grade_id = ref("");
  74. const xueke_id = ref("");
  75. // 初始化数据
  76. const initData =() => {
  77. let transObj = {
  78. school_id:school_id.value,
  79. cm_id: grade_id.value,
  80. xueke_id: xueke_id.value,
  81. jh_id:route.params.ykj_id,//考试计划id
  82. }
  83. cjfx_cjd_list(transObj)
  84. .then(res => {
  85. if (res.code == "1") {
  86. rangeData.value = res.data.data.rangeData;
  87. tableHeader.value = res.data.data.tableHeader;
  88. tableData.value = res.data.data.tableData;
  89. }
  90. })
  91. .catch(error=>{console.log(error)})
  92. }
  93. //option筛选
  94. const optionClick = (val: any, marke: any) => {
  95. if (marke == "scholl") {
  96. school_id.value = val;
  97. } else if (marke == "grade") {
  98. grade_id.value = val;
  99. } else {
  100. xueke_id.value = val;
  101. }
  102. initData();
  103. }
  104. //导出
  105. const exportBtn = () => {
  106. let prefixedUrl = window.GLOBAL_CONFIG.web_pc;
  107. let fullUrl = prefixedUrl + '/openapi/echart/transcript.php?api=xls&token=' + user.value.token;
  108. window.open(fullUrl,'_blank')
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. :deep(.is-group tr th){
  113. background: #003eee!important;
  114. color:#ffffff;
  115. border:0 ;
  116. }
  117. :deep(.el-sub-menu__title){
  118. background: #003eee;
  119. color: #fff;
  120. }
  121. .blueBg {
  122. background: #F1F7FF;
  123. }
  124. .whiteBG {
  125. background: #fff;
  126. }
  127. .mainCotent{
  128. min-height:665px;
  129. }
  130. .singlepart {
  131. background-color: rgba($color: #ffffff, $alpha: 0.2);
  132. color: #fff;
  133. }
  134. .listMain {
  135. max-height: 600px;
  136. overflow-x: auto;
  137. }
  138. .listMain_title {
  139. font-size: 16px;
  140. color: #fff;
  141. background: #003eee;
  142. overflow-y: auto;
  143. }
  144. .singleTitle {
  145. // flex: 1;
  146. // width: fit-content;
  147. line-height: 74px;
  148. width:100px;
  149. text-align: center;
  150. }
  151. .singleDupli {
  152. // flex: 1;
  153. width:150px;
  154. }
  155. .singleContentSec {
  156. // width: fit-content;
  157. // flex: 1;
  158. width:100px;
  159. line-height: 60px;
  160. text-align: center;
  161. }
  162. .singleDSec {
  163. // flex: 1;
  164. line-height: 60px;
  165. width:150px;
  166. }
  167. .secFullWidth {
  168. width: fit-content;
  169. flex: 1;
  170. text-align: center;
  171. }
  172. .perfectShow{
  173. background: url("/images/big_bg.png") no-repeat left top;
  174. background-size:cover;
  175. }
  176. .RankLabel{
  177. text-align: center;
  178. img{
  179. display: inline-block;
  180. width: 30%;
  181. }
  182. }
  183. </style>